// 引入项目中全部的全局组件
import SvgIcon from './SvgIcon/index.vue'
import Category from './Category/index.vue'

import type { App } from 'vue'
// import * as components from './components'

// 引入elemen-plus的全部icon组件
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const allGloablComponent: any = { SvgIcon, Category }

export default {
    install(app: App) {
        // Object.entries(components).forEach(([key, value]) => {
        //     app.component(key, value)
        // })
        Object.keys(allGloablComponent).forEach(key => {
            app.component(key, allGloablComponent[key])
        })
        for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
            app.component(key, component)
        }
    }

}

// export * from './components'